home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
coreaids.arc
/
GET_DIR.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-06-25
|
1KB
|
43 lines
; DESC: gets the current directory path string in the form V1.00
; dir1\dir2\dir3...
; IN: *{DRIVE} drive number of the drive to operate on where
; 0 is the default, 1 is A, etc.
; *{SEG_VAL} segment and
; *{OFFSET} offset of 64 byte user are where resultant string
; will be placed ending with a byte containing 0
; SAMPLE: Callm GET_DIR,<DRIVE,SEG_VAL,OFFSET>,
; ###################################################################
Extrn PUSHALL:Near
Extrn POPALL:Near
Extrn ERRORMSG:Near
GET_DIRC Segment
Assume CS:GET_DIRC
Public GET_DIR
;notice.
DB 'GET_DIR - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
GET_DIR Proc Near ;gets the current directory.
Call PUSHALL
Pop SI ;offset of user area.
Pop DS ;segment of user area.
Pop DX ;drive number.
Mov AH,47H ;gets the current directory.
Int 21H
Jc ERROR ;if error, report it.
Call POPALL
Ret
ERROR: Push AX ;report error and abort.
Call ERRORMSG
GET_DIR Endp
GET_DIRC Ends
End